#include "\life_hc\hc_macros.hpp"
/*
    File: fn_wantedCrimes.sqf
    Author: ColinM
    Assistance by: Paronity
    Stress Tests by: Midgetgrimm

    This file is for Nanou's HeadlessClient.

    Description:
    Grabs a list of crimes committed by a person.
*/

disableSerialization;

params [
    ["_ret",objNull,[objNull]],
    ["_criminal",[],[[]]]
];

private _query = format ["selectWantedActive:%1", _criminal select 0];
private _queryResult = [_query, 2] call HC_fnc_asyncCall;

private _type = _queryResult select 0;
if (_type isEqualType "") then {_type = call compile format ["%1", _type];};

private _crimesArr = [];
{
    private _str = format ["STR_Crime_%1", _x];
    _crimesArr pushBack _str;
    false
} count _type;

_queryResult set[0, _crimesArr];

[_queryResult] remoteExec ["life_fnc_wantedInfo", _ret];
